<template>
	<view>
		<Header title="版本更新" />
		<view class="" style="height: 60rpx;"></view>
		<view class="content">
			<view class="content-content">
				<image class="gengxin" src="@/static/banben.png" mode=""></image>
				<p class="p1">新版本 {{vision}}</p>
				<view class="line"></view>
				<view class="neirong">
					<p class="neirong-p1">android版本更新方式，ios端无效</p>
				</view>
				<view class="neirong">
					<p class="neirong-p1">【更新内容】</p>
					<p class="neirong-p2">{{driverRemark}} </p>
				</view>
				<view class="neirong2">
					<p class="neirong-p1">【更新网址】<span @click="fuzhi">复制</span></p>
					<p class="neirong-p2">https://www.baijixing.com.cn/common/etermial/download</p>
				</view>
				<view class="erweimaBox">
					<image :src="codeUrl" mode=""></image>
				</view>
				<p class="p2">更新二维码</p>
				<u-button class="btn" @click="baocun" text="保存二维码"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	import Header from '@/components/header/header.vue'
	import driver from "@/api/modules/driver.js"
	export default {
		components: {
			Header
		},
		data() {
			return {
				scale: 0,
				vision: "1.1.1",
				driverLink: "",
				driverRemark: "",
				codeUrl:"https://kctchy.oss-rg-china-mainland.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240528154613.png"
			}
		},
		onLoad() {
			driver.queryVision({}).then((res) => {
				var date = res.data.data;
				this.vision = date.driverApp;
				this.driverLink = date.driverLink.split(",")[1];
				this.driverRemark = date.driverRemark;
				
			})
		},
		methods: {
			onScale() {

			},
			fuzhi() {
				uni.setClipboardData({
					data: this.driverLink
				})
			},
			baocun(){
				let that = this
				uni.saveImageToPhotosAlbum({
				    filePath: that.codeUrl, // 需要保存的图片文件路径
				    success(res) {
				        uni.showToast({
				        	title: "保存成功",
				        	icon: "none"
				        })
				    },
				    fail(err) {
				        uni.showToast({
				        	title: "保存失败",
				        	icon: "error"
				        })
				    }
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		box-sizing: border-box;
		padding: 88rpx 30rpx 40rpx;

		.content-content {
			margin-top: 85rpx;
			background: #FFFFFF;
			box-sizing: border-box;
			padding: 70rpx 50rpx;
			position: relative;

			.gengxin {
				position: absolute;
				width: 258rpx;
				height: 195rpx;
				top: -60rpx;
				right: 0;
			}

			.p1 {
				font-size: 38rpx;
				font-family: PingFang SC;
				font-weight: 600;
				color: #1A1A1B;
			}

			.line {
				margin-top: 27rpx;
				width: 48rpx;
				height: 6rpx;
				background: #4DB1FC;
			}

			.neirong-p1 {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #2B2D2F;
				width: 100%;
				word-wrap: break-word;
				margin-bottom: 30rpx;
			}

			.neirong-p2 {
				width: 100%;
				word-wrap: break-word;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #6D6D6D;
			}

			.neirong {
				margin-top: 38rpx;
				width: 590rpx;
			}

			.neirong2 {
				width: 590rpx;
				margin-top: 60rpx;
			}

			.erweimaBox {
				margin: 92rpx auto 0;
				width: 355rpx;
				height: 355rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				background: url('@/static/kuang.png') center center / 100% 100% no-repeat;
				image{
					width: 340rpx;
					height: 340rpx;
				}
			}

			.p2 {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #6D6D6D;
				text-align: center;
			}

			.btn {
				margin-top: 60rpx;
				width: 560rpx;
				height: 98rpx;
				background: #1B252E;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				border-radius: 8rpx;
			}
		}

		movable-view {
			width: 100%;
			height: 100%;
		}

		movable-area {
			height: 100%;
			width: 100%;
		}

		movable-view image {
			width: 100%;
		}
	}
</style>